<link type="text/css" rel="stylesheet" href="{:getRootUrl()}Addons/Redbag/_static/css/redbag.css"/>
<!-- 模态框HTML -->
<form class="ajax-form" method="post" data-role="eject"
      action="{:addons_url('RedBag://RedBag/sendRedBag')}">
    <if condition="!is_login()">
        <div class="need_login_tip">请先登录</div>
    </if>
    <style>
        .modal-dialog {
            width: 400px;
            height: 445px;
        }
        .modal-header {
            background-color: #C82727;;
        }

        .modal-title-name {
            color: #ffffff;
        }
        .modal-body {
            min-height: 384px;
        }
    </style>
    <div>
        <div style="text-align: center;height: 75px">
            <volist name="field" id="vl">
                <div  style="height: 18px" class="col-md-6">
                    <span>{$vl.title}剩余:{$vl.score} </span>
                </div>
            </volist>
        </div>



        <div style="height: 45px">
            <span class="col-md-2 pad0" style="font-size: 14px;height: 32px;padding-top: 2px">红包类型</span>
           <span class="col-md-9 pad0">
        <select data-role="select" name="type" class="chosen-select form-control" tabindex="-1">
            <volist name="field" id="vl">
                <option value="{$vl.id}">{$vl.title}</option>
            </volist>
        </select>
               </span>
        </div>


        <div style="height: 45px" id="allredbag">
            <span class="col-md-2 pad0 " style="font-size: 14px;height: 32px;padding-top: 2px"  >总数额</span>
                 <span class="col-md-9 pad0">
             <input type="text" name="allmoney"  class="chosen-select form-control" placeholder="请输入数字" onKeyPress="if((event.keyCode<48 || event.keyCode>57) && event.keyCode!=46 || /\.\d\d$/.test(value))event.returnValue=false"></span></span>
        </div>
        <div style="height: 45px;display: none"  id="oneredbag">
            <span class="col-md-2 pad0 "  style="font-size: 14px;height: 32px;padding-top: 2px">单个数额</span>
                 <span class="col-md-9 pad0">
             <input type="text" name="onemoney" class="chosen-select form-control" placeholder="请输入数字" onKeyPress="if((event.keyCode<48 || event.keyCode>57) && event.keyCode!=46 || /\.\d\d$/.test(value))event.returnValue=false"></span></span>
        </div>
        <div style="height: 45px">
            <span class="col-md-2 pad0" style="font-size: 14px;height: 32px;padding-top: 2px">红包个数</span>
         <span class="col-md-9 pad0">
          <input type="text" name="num" class="chosen-select form-control"  onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"></span>
            <span class="col-md-1 pad0" style="font-size: 14px;height: 32px;padding-top: 2px">个</span>
        </div>
        <label class="col-md-6 pad0" style="text-align: center">
            <input id="luckredbag" name="red_bag_type" value="2" type="radio" checked >拼手气红包
        </label>
        <label class="col-md-6 pad0" style="text-align: center">
            <input id="redbag" name="red_bag_type" value="1" type="radio">普通红包
        </label>

    </div>

    <div>
        <p><textarea class="form-control " data-role="textarea" name="content" style="height: 6em;"
                     placeholder="恭喜发财，大吉大利！"></textarea></p>
    </div>

    <div style="height: 40px;margin-left: 18px;width: 140px ">
    <span>
        <p class="pull-left" style="margin-right: 5px">
            <input type="submit" data-role="submitreport" value="{:L('_OK_')}" class="btn btn-primary send_box"
            <if condition="!is_login()">disabled="disabled"</if>
            >

        </p>
    </span>
    <span>
        <p class="pull-left" style="margin-left: 5px;">
            <input type="button" value="{:L('_CANCEL_')}" class="btn btn-primary send_box" data-role="cancel"
                   data-dismiss="modal">
        </p>
    </span>
    </div>
</form>
<script>
    $(document).ready(function () {
        $('[data-role="submitreport"]').click(function () {
            $('[data-dismiss="modal"]').click();
        });
    });
    $('#redbag').click(function () {
        $('#allredbag').hide();
        $('#oneredbag').show();
    });
    $('#luckredbag').click(function () {
        $('#oneredbag').hide();
        $('#allredbag').show();

    });



</script>



